Add UTS test specs for LiveObjects path-based API#473
Open
paddybyers wants to merge 16 commits into
Open
Conversation
f355624 to
2e12074
Compare
f8f1b71 to
08789a6
Compare
08789a6 to
97d02db
Compare
Complete portable test suite covering the LiveObjects path-based API: 21 files across unit tests (pure + mock WebSocket), integration tests (sandbox), and proxy integration tests. Covers PathObject, Instance, BatchContext, LiveCounter/LiveMap CRDTs, ObjectsPool sync state machine, value types, subscriptions, and GC. Includes table-driven validation tests, bytes/binary data coverage, and REST fixture provisioning. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove client-side allocated_port/port_base patterns from all proxy test specs and helper docs. Port is now auto-assigned by the proxy when omitted from create_proxy_session(). Matches uts-proxy v0.2.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Align all ~330 LiveObjects UTS test specs with the squashed spec revision a397e34 (LiveObjects path-based API). Key changes: - Add parent_references.md (20 tests): RTLO3f, RTLO4g/4h, RTLO4f, RTO5c10 - Add public_object_message.md (13 tests): PAOM1-3, PAOOP1-3 - Thread ObjectMessage through all CRDT operations and LiveObjectUpdate - Add RTO25 (access preconditions) and RTO26 (write preconditions) - Update subscription model: subscribe returns Subscription object - Add RTO24 (PathObjectSubscriptionRegister) dispatch tests - Add parentReferences maintenance tests to live_map.md (+8 tests) - Add post-sync parentReferences rebuild tests to objects_pool.md (+3) - Rename "consume"/"consumption" to "evaluate"/"evaluation" in value_types - Remove batch.md (Batch API deferred from current spec revision) - Remove subscribeIterator and LiveObject#unsubscribe tests - Update PLAN.md to reflect new file structure and test counts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
97d02db to
2fba05e
Compare
sacOO7
reviewed
Jun 1, 2026
sacOO7
reviewed
Jun 1, 2026
sacOO7
reviewed
Jun 1, 2026
sacOO7
reviewed
Jun 1, 2026
sacOO7
reviewed
Jun 1, 2026
Collaborator
There was a problem hiding this comment.
- We also need to update
Spec File Countssection at uts/README.md. - Looks like the
Directory structuresection needs an update as well. We could potentially remove it altogether—I’m not sure it serves much purpose anymore. WDYT?
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
sacOO7
reviewed
Jun 2, 2026
ttypic
reviewed
Jun 4, 2026
The integration GC tests (RTO10, RTLM19) use enable_fake_timers() + ADVANCE_TIME(), which only affect the SDK's local clock, not the sandbox server. The same scenarios are already covered by unit tests at realtime_object.md (RTO10) and live_map.md (RTLM19) where fake timers work correctly against the mock WebSocket. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Data-path integration tests must run with both JSON and msgpack per G1. Add ## Protocol Variants section and useBinaryProtocol to ClientOptions in objects_lifecycle_test.md and objects_sync_test.md. Update the annotated specs list in integration-testing.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
root is the PathObject at / (a LiveMap). Calling increment/decrement on it would throw 92007 (RTPO17e). The tests intend to operate on the counter at root["score"]. Fixed in realtime_object.md (10 sites) and live_counter_api.md (5 sites). path_object_mutations.md is unchanged — those are intentional negative-path tests for RTPO17e. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests use instance.subscribe() (RTINS16) which emits
InstanceSubscriptionEvent { object, message }, not LiveObjectUpdate
{ tombstone, objectMessage }. Fix all assertions to use .message
instead of .objectMessage, and check .message.operation.action instead
of .tombstone. Also fix noop test serial from "01" to "02" so the
newness check (RTLO4a6) doesn't suppress it before the noop path fires.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Per RTO7a/RTO7b, these attributes belong on RealtimeObject, not ObjectsPool. Add `realtime_object = RealtimeObject(pool: pool)` to affected test setups and redirect all references (8 tests, ~11 lines). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace non-existent getRoot() with get(), and restructure so root is obtained while attached then channel is detached before subscribe(). The previous setup responded to ATTACH with DETACHED, so get() would throw 90001 before reaching subscribe(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace private _liveObject.siteTimeserials access with an observable test: after a local increment (applied via ACK with source LOCAL), send an inbound COUNTER_INC with the same siteCode and serial. If LOCAL incorrectly wrote to siteTimeserials, the newness check would reject the inbound message. The counter reaching 120 proves LOCAL did not pollute siteTimeserials. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of just checking score == 100 after re-sync (which proves nothing since OBJECT_SYNC resets the pool regardless), replay a previously-applied serial after re-sync. If appliedOnAckSerials was properly cleared, the replayed message applies normally and score reaches 110. If not cleared, dedup (RTO9a3) rejects it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add missing protocol message actions from TR2: OBJECT (19), OBJECT_SYNC (20), and ANNOTATION (21). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 tasks
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
uts/objects/Test plan
LiveMap#clear())🤖 Generated with Claude Code